/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.uoc.tdp.pac4.only5.tools;

import java.util.ResourceBundle;

/**
 *
 * @author Gerard
 */
public class ResourceBundleTool {

    private static ResourceBundleTool instance;
    
    private ResourceBundle resourceBundle;
    
    public static final String[] columnsTableResourceBooking = {   "table.extraresources.description", 
                                                                    "table.extraresources.priceDay", 
                                                                    "table.extraresources.priceHour", 
                                                                    "table.extraresources.qtt", 
                                                                    "table.extraresources.totalPrice"};

    public static final String[] columnsTableSpaces = {     "table.spaces.id",
                                                            "table.spaces.desc",
                                                            "table.spaces.capacity",
                                                            "table.spaces.priceh",
                                                            "table.spaces.priced",
                                                            "table.spaces.city",
                                                            "table.spaces.adress",
                                                            "table.spaces.pc",
                                                            "table.spaces.url",
                                                            "table.spaces.howto"};    
    
    private ResourceBundleTool() {
        resourceBundle = ResourceBundle.getBundle("edu.uoc.tdp.pac4.only5.gui.client.Client");
    }

    public static ResourceBundleTool getInstance() {
        return instance == null ? instance = new ResourceBundleTool() : instance;
    }
    
    public String getText(String key){
        return resourceBundle.getString(key);
    }
    
    public String[] getHeaders(String[] headersKey){
        String[] traducedHeaders = new String[headersKey.length];
        for (int i = 0; i < headersKey.length; i++) {
            String traducedHeader = getText(headersKey[i]);
            traducedHeaders[i] = traducedHeader;
        }
        return traducedHeaders;
    }

}
